support function with replace sink and source#823
Merged
Conversation
|
@freeznet:Thanks for your contribution. For this PR, do we need to update docs? |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for source and sink connectors in Pulsar functions, enabling functions to use external connectors (e.g., Kafka, Kinesis) as inputs/outputs instead of traditional Pulsar topics. It also adds configurability for Java instance runtime parameters.
Key changes:
- Added
SourceConnectorSpecandSinkConnectorSpectypes with fields for connector configuration including className, configs, and type information - Extended validation logic to skip input/output topic validation when connectors are configured
- Added logic to inject connector configuration into function specs and command-line arguments
- Added
instancePathandentryClassfields to JavaRuntime for runtime customization
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| api/compute/v1alpha1/function_types.go | Defines new SourceConnectorSpec and SinkConnectorSpec types |
| api/compute/v1alpha1/common.go | Adds InstancePath and EntryClass fields to JavaRuntime |
| controllers/spec/utils.go | Implements connector config extraction and application logic |
| controllers/spec/function.go | Updates function command generation to include connector directory |
| controllers/spec/source.go, sink.go | Updates source/sink command generation with instance path/entry class |
| controllers/spec/common.go | Updates MakeJavaFunctionCommand signature with connector directory and instance parameters |
| pkg/webhook/validate.go | Adds skip flags to validateInputOutput for connector scenarios |
| pkg/webhook/function_webhook.go | Sets skip flags based on connector presence |
| pkg/webhook/source_webhook.go, sink_webhook.go | Updates validation calls with skip flags |
| config/crd/bases/*.yaml | Updates CRD schemas with new fields |
| manifests/*.yaml | Regenerated manifests with new CRD schemas |
| controllers/spec/utils_test.go, function_test.go | Adds test coverage for connector functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nlu90
approved these changes
Nov 10, 2025
jiangpengcheng
approved these changes
Nov 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(If this PR fixes a github issue, please add
Fixes #<xyz>.)Fixes #
(or if this PR is one task of a github issue, please add
Master Issue: #<xyz>to link to the master issue.)Master Issue: #
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Documentation
Check the box below.
Need to update docs?
doc-required(If you need help on updating docs, create a doc issue)
no-need-doc(Please explain why)
doc(If this PR contains doc changes)